package edu.ynu.se.xiecheng.achitectureclass.service;

import edu.ynu.se.xiecheng.achitectureclass.common.service.LogicService;
import edu.ynu.se.xiecheng.achitectureclass.dao.GreenhouseDao;
import edu.ynu.se.xiecheng.achitectureclass.entity.Greenhouse;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GreenhouseService extends LogicService<GreenhouseDao, Greenhouse, Long> {
    public GreenhouseService(GreenhouseDao greenhouseDao) {
        super(greenhouseDao);
    }

    /**
     * 根据名称查询大棚信息
     * @param name 大棚名称
     * @return List<Greenhouse>
     */
    public List<Greenhouse> findByName(String name) {
        return dao.findByNameContaining(name);
    }
}